package b.cif.impl

import b.cif.api.CC客户

/**
  * 贲国称 于 16/12/12 创建。
  */

object O客户State {
  def apply(v客户: CC客户): CC客户State = CC客户State(Option(v客户))
  def apply(): CC客户State = CC客户State(None)
}
case class CC客户State(v客户: Option[CC客户] = None, v账户序号: Int = 0) {
  def f更新账户序号(v序号: Int): CC客户State = v客户 match {
    case None => throw new IllegalStateException("客户未开立")
    case Some(x客户) =>
      val x账户s = x客户.v账号s :+ v序号
      CC客户State(Some(x客户.copy(v账号s = x账户s)), v序号)
  }
}